var express = require('express')
var config = require('./config/index')
var port = process.env.PORT || config.build.port

var app = express()

app.use(express.static('./dist'))

module.exports = app.listen(port, function (err) {
    if (err) {
        console.log(err)
        return
    }
    console.log('Listening at http://localhost:' + port + '\n')
})



app.all('*', function(req, res, next) {
 
res.header("Access-Control-Allow-Origin", "*");
    
res.header("Access-Control-Allow-Headers", "X-Requested-With,Content-Type");
    
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
    
next();
     
})